package com.njdbqn.mybatis2.demo;

import java.io.Reader;

import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;

import com.njdbqn.mybatis2.dao.UserinfosDao;

public class Demo {
	public static void main(String[] args)throws Exception {
		Reader read=Resources.getResourceAsReader("mybatis.cfg.xml");
		SqlSessionFactory factory=new SqlSessionFactoryBuilder().build(read);
		SqlSession session=factory.openSession();
		UserinfosDao usdao=session.getMapper(UserinfosDao.class);
		
		usdao.deleteUser(1);
		session.commit();
	}
}
